package cn.activiti.demo.dimission.service;

import cn.activiti.demo.dimission.model.Note;
import cn.activiti.demo.dimission.model.ProcessElement;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.runtime.ProcessInstance;

import java.io.OutputStream;
import java.util.List;

/**
 * 报销流程业务接口
 */
public interface ExpenseAccountActivitiService {
    String deployProcess();

    /**
     * 开始报销流程
     * @param key
     */
    void startProcessByKey(String key);

    ProcessInstance editAndSave(Note note);

    void submit(String business);

    void auditReject(String businessKey, String rejectedReason);

    void auditApprove(String businessKey);

    void settlement(String businessKey);

    JSONArray watchProcess(String processInstanceId);

//    List<HistoricActivityInstance> watchProcessWithNextStep(String processInstanceId);
    List<ProcessElement>  watchProcessWithNextStep(String processInstanceId);

    JSONArray watchProcessWithNextStepJSON(String processInstanceId);

    void watchProcessImage(OutputStream outputStream);

    void watchProcessActivitiedImage(OutputStream outputStream, String processInstanceId);

    JSONObject getNextTask(String processInstanceId);
}
